package com.djj.nanny.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@TableName("chat_session")
public class ChatSession {
    @TableId(type = IdType.AUTO)
    private Long id;

    private Long userId;     // 普通用户ID
    private Long staffId;    // 服务人员ID
    private String lastMessage; // 最后一条消息内容
    private Integer unreadCount; // 未读消息数
    private Long lastSenderId;   // 最后发送消息的用户ID
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime lastMessageTime; // 最后消息时间

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableLogic
    private Integer isDeleted;

    // 非数据库字段
    @TableField(exist = false)
    private User user;

    @TableField(exist = false)
    private ServiceStaff staff;
} 